package com.cncytech.uiautomator_demo.testcase;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.utils.Describe;

import org.junit.Rule;
import org.junit.Test;

/**
 * 红外测试
 */
public class IrPoliciesTest extends BaseTest {
    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.IR_FORBIDDEN)
    public void irForbiddenTest() {
        String msg = TestConstant.IR_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg, hmm.setIrPolicies(status));
        int irPolicies = hmm.getIrPolicies();
        assertThat(msg, irPolicies, is(status));
    }

    @Test
    @Describe(TestConstant.IR_ENABLE)
    public void irEnableTest() {
        String msg = TestConstant.IR_ENABLE + TestConstant.FAILURE;
        int status = 1;
        assertThat(msg, hmm.setIrPolicies(status));
        int irPolicies = hmm.getIrPolicies();
        assertThat(msg, irPolicies, is(status));
    }
}
